package com.shuzixiangcun.service.front;

import com.shuzixiangcun.dao.XiangcunchanyeiDao;
import com.shuzixiangcun.entity.Xiangcunchanyei;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * 乡村产业表(Xiangcunchanyei)表服务实现类
 *
 * @author makejava
 * @since 2024-06-24 08:26:19
 */
@Service
public class XiangcunchanyeiFServiceImpl {
    @Resource
    private XiangcunchanyeiDao xiangcunchanyeiDao;

    /**
     * 通过ID查询单条数据
     *
     * @param industryId 主键
     * @return 实例对象
     */

    public Xiangcunchanyei queryById(Object industryId) {
        return this.xiangcunchanyeiDao.queryById(industryId);
    }

    /**
     * 分页查询
     *
     * @param xiangcunchanyei 筛选条件
     * @param pageRequest     分页对象
     * @return 查询结果
     */


    /**
     * 新增数据
     *
     * @param xiangcunchanyei 实例对象
     * @return 实例对象
     */

    public Xiangcunchanyei insert(Xiangcunchanyei xiangcunchanyei) {
        this.xiangcunchanyeiDao.insert(xiangcunchanyei);
        return xiangcunchanyei;
    }

    /**
     * 修改数据
     *
     * @param xiangcunchanyei 实例对象
     * @return 实例对象
     */

    public Xiangcunchanyei update(Xiangcunchanyei xiangcunchanyei) {
        this.xiangcunchanyeiDao.update(xiangcunchanyei);
        return this.queryById(xiangcunchanyei.getIndustryId());
    }

    /**
     * 通过主键删除数据
     *
     * @param industryId 主键
     * @return 是否成功
     */

    public boolean deleteById(Object industryId) {
        return this.xiangcunchanyeiDao.deleteById(industryId) > 0;
    }
}
